import Vue from 'vue'
import VueRouter from 'vue-router'
// 登录--主页
import Login from '../components/login.vue'
import Home from '../components/Home.vue'
//用户管理
import Users from '../components/user/users.vue'
//权限管理
import Rights from '../components/right/rights.vue'
import Roles from '../components/right/roles.vue'
//商品管理
import Goods from '../components/goods/list.vue'
import AddGoods from '../components/goods/addgoods.vue'
import Categories from '../components/goods/categories.vue'
import Params from '../components/goods/params.vue'
//订单管理
import Order from '../components/order/order.vue'
//数据可视化
// const DataView = () => import('../components/DataViews.vue')
import DataView from '../components/DataView.vue'

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: 'login' },
  { path: '/login', component: Login },
  {
    path: '/home',
    component: Home,
    children: [
      { path: '/users', component: Users },
      { path: '/rights', component: Rights },
      { path: '/roles', component: Roles },
      { path: '/goods', component: Goods },
      { path: '/addGoods', component: AddGoods },
      { path: '/categories', component: Categories },
      { path: '/params', component: Params },
      { path: '/orders', component: Order },
      // { path: 'reports', component: DataView }
    ]
  },
  // {
  //   path: '/reports', component: DataView
  // }
]

const router = new VueRouter({
  routes
})

export default router
